home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / science / sm32a.zip / SYMBMATH.H38 < prev    next >
Text File  |  1993-11-14  |  4KB  |  147 lines

  1.             4.6 Integration
  2.  
  3.     You can find integrals of x^m*e^(x^n), x^m*e^(-x^n),
  4. e^((a*x+b)^n), e^(-(a*x+b)^n), x^m*ln(x)^n, ln(a*x+b)^n, etc., (where m
  5. and n are any real number).        
  6.     It is recommended that before you do symbolic integration, you
  7. should simplify integrand, e.g. expand the integrand by expand() and/or
  8. by setting the switch expand:=on and/or expandexp:=on.
  9.     If symbolic integration fails, you can define a simple integral
  10. and/or derivative, (or adding integral into the inte.(x) library),
  11. then do integration again (see Chapter 4.14 Learning from User).
  12.  
  13.         4.6.1 Indefinite Integration
  14.     Find the indefinite integrals of expr by
  15.         inte(expr, x)
  16.     Find the double indefinite integrals by
  17.                 inte(inte(expr, x), y)
  18. Note that the arbitrary constant is not represented.
  19.  
  20.     Example 4.6.1. 
  21.         Find integrals of 1/a, 1/b and 1/x, knowing a >0, b is real.
  22.  
  23. IN:  assume(a>0), isreal(b):=1
  24. IN:  inte(1/a, a), inte(1/b, b), inte(1/x, x)
  25. OUT: ln(a), ln(|b|), ln(x*sign(x))
  26.  
  27.     Example 4.6.2. 
  28.         Find indefinite integrals.
  29.  
  30. IN:  inte(sin(a*x+b), x)        # integrands involving sin(x)
  31. OUT: -cos(b + a x)/a
  32. IN:  inte( sin(x)/x^2, x)
  33. OUT: ci(x) - sin(x)/x
  34. IN:  inte( x*sin(x), x)
  35. OUT: -x cos(x) + sin(x)
  36. IN:  inte(sin(x)*cos(x), x)
  37. OUT: (1/2)*sin(x)^2
  38.  
  39. IN:  inte( e^(x^6), x)              # integrands involving e^x
  40. OUT: 1/6 ei(-5/6, x^6)
  41. IN:  inte( x^2*e^x, x)
  42. OUT: ei(2, x)
  43. IN:  inte( x*e^(-x), x)
  44. OUT: -e^(-x) - x e^(-x)
  45. IN:  inte( e^x/sqrt(x), x)
  46. OUT: ei(-0.5, x)
  47. IN:  inte(x^1.5*exp(x), x)
  48. OUT: ei(1.5, x)
  49.  
  50. IN:  inte(sin(x)*e^x, x)      # integrals involving sin(x) and e^x
  51. OUT: 1/2 * (sin(x) - cos(x)) * e^x
  52.  
  53. IN:  inte( x*ln(x), x)             # integrands involving ln(x)
  54. OUT: -1/4 x^2 + 1/2 x^2 ln(x)
  55. IN:  inte( ln(x)^6, x)
  56. OUT: li(6, x)
  57. IN:  inte( ln(x)/(√x), x)
  58. OUT: -4 √x + 2 √x ln(x)
  59. IN:  inte( ln(x)/sqrt(1 + x), x)
  60. OUT: -4 √(1 + x) + 2 √(1 + x) ln(x) - 2 ln((-1 + √(1 + x))/(1 + √(1 + x)))
  61.  
  62. IN:  inte( 1/(a x + b), x)        # integrands involving polynomials
  63. OUT: ln((b + a x) sign(b + a x))/a
  64. IN:  inte( x/(x^2 + 5 x + 6), x)
  65. OUT: 1/2 ln(|6 + 5 x + x^2|) - 5/2 ln(|(2 + x)/(3 + x)|)
  66. IN:  inte( (x^3 + x)/(x^4 + 2 x^2 + 1), x)
  67. OUT: 1/4 ln((1 + 2 x^2 + x^4) sign(1 + 2 x^2 + x^4))
  68.  
  69.     Example 4.6.3. 
  70.         Find the line integral.
  71.  
  72. IN:  x:=2*t
  73. IN:  y:=3*t
  74. IN:  z:=5*t
  75. IN:  u:=x+y
  76. IN:  v:=x-y
  77. IN:  w:=x+y+z
  78. IN:  inte(u*d(u,t)+v*d(v,t)+w*d(w,t), t)
  79. OUT: 63 t^2
  80.  
  81.     Example 4.6.4. 
  82.         Integrate x^2*e^x, then expand it by the mean of the
  83. packages "ExpandEi.sm" (expand ei(n,x)).  The packages "ExpandGa.sm"
  84. (expand gamma(n,x)) and "ExpandLi.sm" (expand li(n,x)) are similar one.
  85.  
  86. IN:  inte(x^2*e^x, x)
  87. OUT: ei(2,x)                                 # ei()
  88. IN:  readfile("ExpandEi.sm")
  89. IN:  ei(2, x)
  90. OUT: x^2 e^x - 2 x e^x + 2 e^x               # ei() is expanded
  91.  
  92.  
  93.     Defining integrals is similar to defining rules.
  94.     Example 4.6.5
  95.  
  96. IN:  inte(f(x_), x_) := sin(x)
  97. IN:  inte(f(t), t)
  98. OUT: sin(t)
  99.  
  100.         4.6.2 Definite Integration
  101.     Find definite integrals by external functions 
  102.         inte(expr, x from xmin to xmax)
  103.         inte(expr, x from xmin to singularity to xmax)
  104.        
  105.        Example 4.6.6. 
  106.        Find the definite integral of y=exp(1-x) with respect to x taken
  107. from 0 to infinity.
  108.  
  109. IN:  inte(exp(1-x), x from 0 to inf)
  110. OUT: e
  111.  
  112.     Example 4.6.7. 
  113. do discontinuous integration of 1/x^2 and 1/x^3 with discontinuty at x=0.
  114.  
  115. IN:  inte(1/x^2, x from -1 to 2)             # singularity at x=0
  116. OUT: inf
  117. IN:  inte(1/x^3, x from -1 to 1)             # singularity at x=0
  118. OUT: 0
  119. IN:  inte(sqrt((x-1)^2), x from 0 to 2)      # singularity at x=1
  120. OUT: 1
  121.  
  122.         SymbMath usually detect singularity, but sometime it cannot,
  123. in this case you must provide singularity.
  124.         Example:
  125. IN:  inte(1/(x-1)^2, x from 0 to 1 to 2)     # provide singularity at x=1
  126. OUT: inf
  127.  
  128.     Example 4.6.8
  129.         do complex integration.
  130.  
  131. IN:  inte(1/x, x from i to 2*i)
  132. OUT: ln(2)
  133.  
  134.         4.6.3  Numeric Integration: NInte()
  135.     The external function
  136.         ninte(y, x from xmin to xmax)
  137. does numeric integration.
  138.     
  139.     Example 4.6.3.1. 
  140.         Compare numeric and symbolic integrals of 4/(x^2+1) with
  141. respect to x taken from 0 to 1.
  142.  
  143. IN:  ninte(4/(x^2+1), x from 0 to 1)
  144. OUT: 3.1415
  145. IN:  num(inte(4/(x^2+1), x from 0 to 1))
  146. OUT: 3.1416
  147.